package vip.mtdp.common.exception;

import lombok.Data;
import lombok.ToString;

/**
 * @author wangguoqing
 * @Description app 异常
 * @date 2019/11/29 19:06
 */
@Data
@ToString
public class AppRTException extends RuntimeException {

    public static Integer DEFAULT_CODE = 500;

    private String code;

    private String message;

    public AppRTException(){
        super();
    }

    public AppRTException(Throwable throwable){
        super(throwable);
    }

    public AppRTException(String code,String message){
        super(code + ":" + message);
        this.code = code;
        this.message = message;
    }

    public AppRTException(int code,String message){
        super(code + ":" + message);
        this.code = String.valueOf(code);
        this.message = message;
    }

    public AppRTException(String message){
        super(AppRTException.DEFAULT_CODE + ":" + message);
        this.code = String.valueOf(AppRTException.DEFAULT_CODE);
        this.message = message;
    }



}
